//
//(C) Copyright 2011 HongKong Airline.,Ltd. 
//
/**
 * contactPersonAction
 * 项目名称:代购系统
 * @author Mengxiangliang
 * 功能描述:
 * 历史版本:2013-01-04 v1.0.0 Mengxiangliang  创建:
 * @version [V1] 
 */
package com.gamutsoft.amb.contactperson.action;

import java.util.List;
import java.util.Map;

import com.gamutsoft.amb.base.action.BaseAction;
import com.gamutsoft.amb.common.bean.QueryExample;
import com.gamutsoft.amb.common.exception.BusinessException;
import com.gamutsoft.amb.common.util.ConditionUtil;
import com.gamutsoft.amb.common.util.PageUtil;
import com.gamutsoft.amb.contactperson.model.ContactPerson;
import com.gamutsoft.amb.contactperson.service.IContactPersonService;


@SuppressWarnings({"serial","rawtypes"})
public class ContactPersonAction extends BaseAction {
	
	private ContactPerson contactPerson;
	
	private List<Map> contactPersonList;
	
	private IContactPersonService contactPersonService;

	/**
	 * 初始化查询ContactPerson信息
	 * @author Mengxiangliang
	 * @return
	 */
	public String initSearchContactPerson()throws BusinessException, Exception {
		try {
		    QueryExample qe =ConditionUtil.copyConditionBySql(this.getRequest());
			PageUtil  pageutil =new PageUtil(this.getRequest());
			pageutil.setPageSize(PageUtil.PAGESIZE);
			qe.setPageUtil(pageutil);
			contactPersonList = contactPersonService.searchContactPersonList(qe);
		
		} catch(BusinessException be){
			log.error(be);
			throw be;
		}catch(Exception e){
			log.error(e);
			throw e;
		}
		return "init_search_contactPerson_success";
	}

	/**
	 * @return the contactPerson
	 */
	public ContactPerson getContactPerson() {
		return contactPerson;
	}

	/**
	 * @param contactPerson the contactPerson to set
	 */
	public void setContactPerson(ContactPerson contactPerson) {
		this.contactPerson = contactPerson;
	}

	/**
	 * @return the contactPersonList
	 */
	public List<Map> getContactPersonList() {
		return contactPersonList;
	}

	/**
	 * @param contactPersonList the contactPersonList to set
	 */
	public void setContactPersonList(List<Map> contactPersonList) {
		this.contactPersonList = contactPersonList;
	}
	/**
	 * @param contactPersonService the contactPersonService to set
	 */
	public void setContactPersonService(IContactPersonService contactPersonService) {
		this.contactPersonService = contactPersonService;
	}
}
